package base.day07;

import javax.swing.*;

public class study2 {
    public static void main(String[] args) {
        JFrame jf = new JFrame();
        jf.setTitle("聊天室");
        jf.setSize(400, 300);
        jf.setDefaultCloseOperation(3);
        jf.setLocationRelativeTo(null);
        jf.setAlwaysOnTop(true);
        jf.setLayout(null);

        //聊天口
        JTextArea chatMouth = new JTextArea();
        chatMouth.setBounds(10, 10, 360, 200);
        jf.add(chatMouth);

        //输入聊天文本框
        JTextField chatTextBox = new JTextField();
        chatTextBox.setBounds(10, 230, 180, 20);
        jf.add(chatTextBox);

        //发送按钮
        JButton sendButton = new JButton("发送");
        sendButton.setBounds(200, 230, 70, 20);
        jf.add(sendButton);
        //清空聊天按钮
        JButton clearChatButton = new JButton("清空聊天");
        clearChatButton.setBounds(280, 230, 100, 20);
        jf.add(clearChatButton);

        jf.setVisible(true);


    }
}
